#include <stdio.h>

extern "C"
{
	#include "lua.h"
	#include "lualib.h"
	#include "lauxlib.h"
	#include "luaconf.h"
}
#include "tolua++.h"
#include"student.h"

int g_array[10];
extern int tolua_lua_student_open(lua_State* tolua_S);

int main(int argc, char* argv[])
{
	lua_State* L = luaL_newstate();
    int i = 0;
    for (i = 0; i < 10; ++i) {
        g_array[i] = i;
    }

	luaL_openlibs(L);
    lua_checkstack(L, 65535);

	tolua_lua_student_open(L);

	luaL_dofile(L, "./student.lua");
	lua_close(L);

    for (i = 0; i < 10; ++i) {
        printf("%d\n", g_array[i]);
    }

	return 0;
}
